<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->

    <script src="js/jquery-2.1.1.min.js"></script>
    <script src="js/zhangyue6.4.js"></script>

    <!--引入bootstrap文件-->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <!--引入index.css-->
    <link rel="stylesheet" href="css/index.css">
    <!--引入ico小图标 -->
    <link rel="shortcut icon" href="favicon.ico"  type="image/x-icon"/>
    <title>云智教育</title>
</head>
<body>
    <header class="container">
        <div class="row">
            <div class="col-md-5">
                <div class="fixed">
                    <!--左侧头部-->
                    <ul class="nav">
                        <li><a href="index.html">首页</a></li>
                        <li><a href="class_list.html">课程</a></li>
                        <!--<li><a href="#">职业规划</a></li>-->
                        <li><a onclick="_sousuo()" class="glyphicon glyphicon-search"></a></li>
                    </ul>
                    <!--左侧中间-->
                    <div class="middle">
                            <h3 class="word">云智教育，学有所成</h3>
                                <span class="glyphicon glyphicon-education"></span>
                            <footer id="footer">

                            </footer>
                    </div>
                </div>
            </div>
            <article class="col-md-7">
                <div class="box" >
                    <div class="box-hd">
                        <h3>全部课程</h3>
                    </div>
                    <div class="box-bd clearfix">
                        <ul id="c_list">

                        </ul>
                    </div>
                </div>
                <!--box end -->
            </article>
        </div>
    </header>
</body>
<script src="js/html.js"></script>
<script>

    const _getlistall = function(){
        shuju.set('method','getlist');
        shuju.getshuju('kecheng',{
            success:function(data){
                let info = data.data;
                let html = [];
                for(let i=0;i<info.length;i++){
                    html.push(H_class(info[i]));
                }
                document.getElementById('c_list').innerHTML=html.join('');
            },
            error:function(e){
                alert('网络错误');
            }
        });
    };

    const _getlist = function(t){
        shuju.set('uid',mydata.get('id'));
        shuju.set('method','get'+t+'_PC');
        shuju.getshuju('kecheng',{
            success:function(data){
                let info = data.data;
                let html = [];
                if(info.length==0){
                    alert('没有相关信息');
                    window.location.href='index.html';
                }
                for(let i=0;i<info.length;i++){
                    html.push(H_class(info[i]));
                }
                document.getElementById('c_list').innerHTML=html.join('');
            },
            error:function(e){
                alert('网络错误');
            }
        })
    };

    const type = window.location.href.split('type=')[1];
    if(!type || type==""){
        //全部
        _getlistall();
    }else{
        _getlist(type);
    }


</script>
</html>